﻿<%@ Page Language="C#" MasterPageFile="~/FB.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Help_Default" Title="Help" %>
<%@ MasterType TypeName="FB" %>

<asp:Content ID="cHead" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="cMain" ContentPlaceHolderID="main" Runat="Server">

    <asp:Panel ID="pnlBefore" runat="server">
        <div class="bar clearfix tab_bar">
            <div id="tabs">
                <div class="activetab"><a href="">Step 1: Setup prank</a></div>
                <div class="disabled">Step 2: Review prank</div>
            </div>
        </div>

        <div class="editor_panel clearfix">
            <table class="editor" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr class="select">
                        <td class="label">Prank<br /><small>(required)</small></td>
                        <td>
                            <asp:DropDownList ID="ddlPranks" runat="server" DataSourceID="dsPranks" 
                                DataTextField="text" DataValueField="id" AppendDataBoundItems="true">
                                <asp:ListItem Text="Select one of the following pranks:" Value="0" />
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="valPranks" runat="server" 
                                ControlToValidate="ddlPranks" ErrorMessage="*" 
                                InitialValue="0"/>
                        </td>
                    </tr>
                    <tr class="textarea tallrow">
                        <td class="label">Target(s)<br /><small>(required)</small></td>
                        <td>
                            <asp:ListBox runat="server" ID="lbFriends" SelectionMode="Multiple" Rows="10"
                                DataSourceID="dsFriends" DataTextField="name" DataValueField="uid" />                    
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div class="buttons">
                                <asp:Button ID="btnOk" runat="server" Text="Create Prank" CssClass="inputbutton" onclick="btnOk_Click" />
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>     
    </asp:Panel>
    
    <asp:Panel ID="pnlAfter" runat="server" Visible="false">
        <div class="bar clearfix tab_bar">
            <div id="tabs">
                <div class="disabled">Step 1: Setup prank</div>
                <div class="activetab"><a href="">Step 2: Review prank</a></div>
            </div>
        </div>        
        <div class="editor_panel clearfix">
            <table class="editor" cellpadding="0" cellspacing="0">
                <tbody>    
                    <tr>
                        <td colspan="2">
                            <b>Prank # <asp:Label ID="lblPrankNo" runat="server" /></b> has been sent 
                            to <b><asp:Label ID="lblTargetCount" runat="server" /> unsuspecting recipients</b>.
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </asp:Panel>
   
    <!-- Data Sources -->
    <fb:FqlDataSource runat="server" ID="dsFriends" FqlQuery="SELECT name, uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=@UserID) ORDER BY first_name">
        <Parameters>
            <asp:ControlParameter Name="UserID" ControlID="fbapp" PropertyName="UserID" />
        </Parameters>
    </fb:FqlDataSource>   
    <asp:XmlDataSource ID="dsPranks2" runat="server" DataFile="~/App_Data/Pranks.xml" />
    <asp:LinqDataSource ID="dsPranks" runat="server" 
        ContextTypeName="DBDataContext" OrderBy="id" Select="new (id, text)" 
        TableName="pranks">
    </asp:LinqDataSource>
</asp:Content>

